package cn.tedu.micro.service.order.openfeign.client;

import cn.tedu.micro.service.common.JsonResult;
import cn.tedu.micro.service.order.sentinel.OrderFallbackError;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

//需要借助openfeign提供的@FeignClient指定要调用的服务名称
//服务名称需要和nacos中的服务名称一致
@FeignClient("micro-service-stock")
public interface StockClient {
    //减少库存的接口
    @PostMapping("/stock/reduce")
    JsonResult reduceStock(@RequestParam("productCode") String productCode,
                          @RequestParam("count") Integer count);

}
